<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>浮动</title>
    <style>
        #d1{
            width: 500px;
            height:500px;
            border:1px solid black;
        }
        #dd1,#dd2{
            width: 100px;
            height:100px;
        }
        #dd1{
            background: rebeccapurple;
            float:right;
        }
        #dd2{
            background: #EDB21C;

        }
        #s2{
           float:right
       }
       #s1{
           float:right
       }


    </style>
</head>
<body>
    <div id="d1">
        <div id="dd1"></div>
        <div id="dd2"></div>

        <span id="s1">窗前明月光</span>
        <span id="s2">疑是地上霜</span>
    </div>
</body>
</html>